<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<script src="js/rem.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" type="text/css" href="fonts/iconfont.css"/>
		<link rel="stylesheet" type="text/css" href="css/base.css"/>
		<link rel="stylesheet" type="text/css" href="css/master.css"/>
		<script src="js/axios.min.js" type="text/javascript" charset="utf-8"></script>
		
	</head>
	<body>
		
		<script type="text/javascript">
			window.onload=function(){
				let token=localStorage.getItem('token')
			let spans =document.querySelectorAll('.tokenText span')
			console.log(spans)
			if(token==null){
				location.href='login.html'
			}else{
				console.log(1)
			}
			
			//粉丝数量接口
			let fansApi='http://15637237221.wicp.vip/yh/mine/fanUser.do'
			
			axios.post(fansApi,{
				token
			}).then(res=>{
				console.log(res)
				let html=`${res.data.code}获赞`
				spans[0].innerHTML=html
			})
			// 
			// let focusApi='http://15637237221.wicp.vip/yh/mine/fanUser.do'
			// 
			// axios.post(focusApi,{
			// 	token
			// }).then(res=>{
			// 	console.log(res)
			// 	let html=`${res.data.code}粉丝`
			// 	spans[1].innerHTML=html
			// })
			
			//关注数量接口
			let collectApi='http://15637237221.wicp.vip/yh/mine/followFan.do'
			
			axios.post(collectApi,{
				token
			}).then(res=>{
				console.log(res);
				let html1=`${res.data.info.fan}粉丝`
					spans[1].innerHTML=html1
			
				let html=`${res.data.info.follow}关注`
				spans[2].innerHTML=html
			})
			
			
			
			
			
			
			//用户信息接口
			let UserMassegetApi='http://15637237221.wicp.vip/yh/mine/showUserInformation.do'
			axios.post(UserMassegetApi,{
				token
			}).then(res=>{
				console.log(res.data.info);
				let obj=res.data.info
				let userImg=document.querySelector('.self-pic-wrap')
				let html=''
				html=`<img src="${obj.userImgUrl}">`
				userImg.innerHTML=html;
				let userName=document.querySelector('.userName')
				let userId=document.querySelector('.userId')
				let html1=''
				html1=`${obj.username}`
				userName.innerHTML=html1;
				let html2=''
				html2=`ID:${obj.id}`
				userId.innerHTML='ID:111111';
				localStorage.setItem('userId',obj.userId)
			})
			
			
			
			//修改用户ID
			let updateUserIdApi='http://15637237221.wicp.vip/yh/mine/updateUserOfId.do'
			axios.post(updateUserIdApi,{
				token,
				id:'123123'
				
			}).then(res=>{
				console.log(res)
			})
			
			}
			
			
			
			
			
		</script>
		<div class="container">
			<header id="selfcenter-top">
				<img src="img/top.png" class="zhuangtailan">
				<p><span>个人中心 </span>	<a href="msg.html"><em class="iconfont icon-xiaoxi"></em></a></p>
			<figure>
					<a href="">我的美术馆</a>
					<div class="self-pic-wrap">
						<!-- <img src="img/IMG_20190511_110952.jpg" > -->
					</div>
					<figcaption>
						<p class="userName"><!-- 莫相识 --></p>
						<p class="userId"><!-- ID:360153 --></p>
						<p class="tokenText"><span><!-- 0获赞 --></span><span><!-- 0粉丝 --></span><a href="userFollow.html"><span><!-- 0关注 --></span></a></p>
						<p><a href="vip.html">VIP特权</a><span>856节艺术课任你选</span><a href="vip.html">开通</a></p>
						<b class="selfcenter-border"></b>
					</figcaption>
				</figure>
			</header>
			<main id="self-con">
				
				
				<div class="meet-tit"><em class="meet-left"></em><spsn>正在画的</spsn> <a href="">暂无</a ><a href="" class="iconfont icon-dayuhao
"></a></div>
				<div class="meet-tit"><em class="meet-left"></em><span>收藏课程</span> <a href="">更多</a ><a href="" class="iconfont icon-dayuhao
"></a><br>


				<ul class="collect-list">
					<li>
						<div class="self-pic-wrap">
					<img src="img/girl.jpg" >
					
				</div>
				<p id="weimei">唯美水彩创作—奇幻风格</p>
					</li>
					
					<li>
							<div class="self-pic-wrap">
						<img src="img/girl.jpg" >
						
					</div>
					<p id="weimei">唯美水彩创作—奇幻风格</p>
						</li>
						<li>
								<div class="self-pic-wrap">
							<img src="img/girl.jpg" >
							
						</div>
						<p id="weimei">唯美水彩创作—奇幻风格</p>
							</li>
				</ul>
				
				
				
				</div>
				<div class="meet-tit tit-border"><em class="meet-left"></em><a href="">我的拼团</a></div>
				<div class="meet-tit tit-border"><em class="meet-left"></em><a href="">我的作业</a></div>
				<div class="meet-tit tit-border"><em class="meet-left"></em><a href="mydir.html">我的笔记</a></div>
				<div class="meet-tit tit-border"><em class="meet-left"></em><a href="">毕业证书</a></div>
				<div class="meet-tit tit-border"><em class="meet-left"></em><a href="tuiguangzhongxin.html">推广中心</a></div>
				<div class="meet-tit tit-border"><em class="meet-left"></em><a href="money.html">优惠券</a></div>
				<div class="meet-tit tit-border"><em class="meet-left"></em><a href="set.html">设置</a></div>
				<div class="meet-tit tit-border"><em class="meet-left"></em><a href="back.html">意见反馈</a></div>
			</main>
			<footer>
			<a href="index-rec.html">
									<span class="iconfont icon-shouye
			"></span>
									<p>首页</p>
								</a>
								
								<a href="meet.html">
									<span class="iconfont icon-tupian"></span>
									<p>遇见</p>
								</a>
								
								<a href="community-focus.1.html ">
									<span class="iconfont icon-shequ-weijihuo" style="color: #fff;"></span>
									<p style="color: #fff;">社区</p>
								</a>
								
								<a href="selfcenter.html" class="btns-spec">
									<span class="iconfont icon-wode" style="color: #EEC14F;"></span>
									<p style="color: #EEC14F;">我的</p>
								</a>
			</footer>
		</div>
	</body>
</html>
